@import '~scss/variables';
@import '~scss/mixins';

.header {
  display: flex;
  padding: 12px;
  padding-bottom: 20px;
  background-color: $th-bg-color;

  .search {
    width: 100%;
  }

  .actions {
    flex: 1 0 auto;

    :global {
      button {
        margin-left: 12px;

        &:hover {
          background-color: $bg-color;
        }
      }
    }
  }
}

.item {
  position: relative;
  padding: 4px 12px;
  background: $light-color01;

  .content {
    padding: 12px;
    border: 1px solid $light-color06;
    border-radius: 4px;
    background: $white;
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-basis: 369px;

    .head {
      display: flex;
      width: 37.73%;
      overflow: hidden;

      & > div {
        &:nth-of-type(2) {
          width: calc(100% - 64px);
          margin-right: 12px;
        }
      }

      .headIcon {
        margin-right: 12px;
        position: relative;

        &::after {
          content: '';
          position: absolute;
          width: 8px;
          height: 8px;
          border-radius: 50%;
          bottom: 2px;
          right: 2px;
          z-index: 6;
        }

        &::before {
          content: '';
          position: absolute;
          width: 12px;
          height: 12px;
          border-radius: 50%;
          bottom: 0px;
          right: 0px;
          opacity: 0.16;
          z-index: 5;
        }
      }

      .headLine {
        display: flex;
        align-items: center;

        img {
          width: 16px;
          height: 16px;
          margin: 0px 8px;
        }

        .severity {
          white-space: nowrap;
          word-wrap: none;
          font-weight: 600;
          font-size: 12px;
          line-height: 20px;
          padding: 0px 4px;
          background: $light-color04;
          border-radius: 2px;
        }
      }

      .statusLine {
        font-weight: 400;
        font-size: 12px;
        line-height: 20px;
        display: flex;
        align-items: center;

        & > span {
          margin-right: 4px;
        }
      }
    }

    .target {
      width: 44.68%;
    }

    .timeLabel {
      width: 17.59%;
      padding-left: 12px;
      user-select: none;

      .time {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        font-weight: 600;
        font-size: 12px;
        line-height: 20px;
        color: #242e42;
      }

      .time_white {
        font-weight: 600;
        font-size: 12px;
        line-height: 20px;
        color: #fff;
      }
    }

    :global {
      .icon {
        transition: all $trans-speed;
      }
    }

    .title {
      font-weight: 600;
      font-size: 12px;
      line-height: 20px;
      color: $dark-color07;
      overflow: hidden;
      max-width: 369px;
      white-space: nowrap;
      text-overflow: ellipsis;
    }

    .desc {
      font-weight: 400;
      font-size: 12px;
      line-height: 20px;
      color: $dark-color01;
    }
  }

  .expanded {
    background: $dark-color07;
    border: 1px solid $dark-color07;

    :global {
      .kubed-icon-chevron-down {
        transform: rotate(180deg);
      }
    }

    .title {
      color: $white;
    }

    .desc {
      color: $light-color01;
    }
  }
}

.itemExtra {
  position: absolute;
  display: none;
  width: calc(100% - 32px);
  top: calc(100% - 12px);
  left: 16px;
  z-index: 100;
  background: $white;
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25), 0px 1px 0px $dark-color01,
    -1px 0px 0px $dark-color01, 1px 0px 0px $dark-color01;
  border-radius: 0px 0px 4px 4px;
  padding: 12px;

  .ms_content {
    padding: 8px 12px;
    background: $light-color01;
    border-radius: 4px;
    font-weight: 400;
    font-size: 12px;
    line-height: 20px;

    .ruleExpr {
      font-family: 'Monaco';
      font-style: normal;
      font-weight: 400;
      font-size: 12px;
      line-height: 20px;
      word-break: break-all;
    }

    .label {
      color: $dark-color01;
      margin-right: 4px;
    }

    .value {
      color: $dark-color06;
      margin-right: 4px;
    }

    p {
      &:nth-of-type(even) {
        margin-top: 8px;
      }
    }

    &:nth-of-type(even) {
      margin-top: 8px;
    }
  }
}

.itemExtraShow {
  display: block;
}

.status_disabled {
  &::before,
  &::after {
    background: $dark-color01;
  }
}

.status_pending {
  &::before,
  &::after {
    background: $yellow-color03;
  }
}

.status_firing {
  &::before,
  &::after {
    background: $red-color03;
  }
}

.status_inactive {
  &::before,
  &::after {
    background: $green-color03;
  }
}

.info_disabled {
  svg {
    color: $white;
    fill: $dark-color01;
  }
}

.info_pending {
  svg {
    color: $white;
    fill: $yellow-color03;
  }
}

.info_firing {
  svg {
    color: $white;
    fill: $red-color03;
  }
}

.info_inactive {
  svg {
    color: $white;
    fill: $green-color03;
  }
}

.critical {
  background: $red-color03 !important;
  color: $white;
}

.error {
  background: $yellow-color03 !important;
  color: $white;
}

.footer {
  background: $light-color01;
  padding: 6px 20px;
  padding-top: 8px;
}

.pageSizeBox {
  display: flex;
  align-items: center;
  height: 32px;
  overflow: auto;

  .pagesize {
    min-width: 67px;
    cursor: pointer;
    display: flex;
    align-items: center;

    .text {
      font-weight: 600;
      font-size: 12px;
      line-height: 20px;
      color: $dark-color06;
      margin-right: 4px;
    }
  }

  .gap {
    width: 1px;
    height: 12px;
    background: $light-color03;
    margin: 0px 12px;
  }
}

.pageSizeMenu {
  min-width: 96px;
  max-height: 144px;
  overflow: auto;

  .pageSizeMenuitem {
    min-width: 80px;
    height: 32px;
    font-weight: 600;
    font-size: 12px;
    line-height: 20px;
    color: $dark-color04;
    padding: 0 12px;
    display: flex;
    justify-content: center;
    align-items: center;

    &:hover {
      cursor: pointer;
      background: $light-color02;
    }
  }
}
